Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: BN013 plugin to warn on unreferenced resources #431

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

DinoChiesa
Copy link
Collaborator

This is similar to the PR for BN012 that I submitted a little while ago. While that one checks for unreferenced TargetEndpoints, this one checks for unreferenced resources. Any files under the resources/ dir in the proxy bundle.

There are two ways a resource file can be used:

  1. in the special policy type for the resource. Eg, an XSL policy will reference a resource with a path like resources/xsl/something.xsl, while an OASValidation policy will reference a resource with a path like resources/oas/something.yaml . And so on.
  2. In AssignMessage/AssignVariable/ResourceURL . This element can reference any text-style resource.

Exceptions to these checks are:

  1. java - Not possible to know whether a JavaCallout will use a JAR file.
  2. properties - These are implicitly used, and it is not possible to check for any references to properties.

All other types of resource - jsc, py, xsl, wsdl xsd, oas, graphql - are checked.

@ssvaidyanathan ssvaidyanathan merged commit 0a21159 into apigee:main Apr 12, 2024
2 checks passed
@DinoChiesa DinoChiesa deleted the unreferenced-resources branch April 15, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants